/**
 * 
 */
package com.feib.stms.dao.jdbc.rowmapper;

import java.sql.ResultSet;

import org.springframework.jdbc.core.RowMapper;

import com.feib.stms.model.Group;

import com.feib.stms.model.UploadFile;
import com.feib.stms.model.UploadFileTodoList;


/**
 * @author Jeff Gu
 *
 */
public class UploadFileTodoListRowMapper extends BaseRowMapper<UploadFileTodoList> implements RowMapper<UploadFileTodoList>{

	
	private static final long serialVersionUID = 82431026255413207L;

	public UploadFileTodoListRowMapper() {
		super(UploadFileTodoList.class);
	}
	
	@Override
	protected UploadFileTodoList doOtherMapRow(ResultSet rs, int rowNumber,UploadFileTodoList entity )
	{		
		// 塞檔案上傳群組的關聯 
		entity.setGroup(new Group());
		entity.getGroup().setGroupPk((Long)getColumnValue(rs, "GROUP_PK", Long.class));
		entity.getGroup().setGroupNo((String)getColumnValue(rs, "GROUP_NO", String.class));
		entity.getGroup().setGroupName((String)getColumnValue(rs, "GROUP_NAME", String.class));
		entity.getGroup().setGroupType((Integer)getColumnValue(rs, "GROUP_TYPE", Integer.class));
		// 塞檔案關聯 
		entity.setUploadFile(new UploadFile());
		entity.getUploadFile().setUploadFilePk((Long)getColumnValue(rs, "UPLOAD_FILE_PK", Long.class));
		entity.getUploadFile().setFileStatus((Integer)getColumnValue(rs, "FILE_STATUS", Integer.class));
		entity.getUploadFile().setFileFormat((String)getColumnValue(rs, "FILE_FORMAT", String.class));
		entity.getUploadFile().setSecuritiesNo((String)getColumnValue(rs, "SECURITIES_NO", String.class));
		return entity;

	}

}
